import request from '@/utils/http'
import { BaseResponse } from '@/types/api'

// 首页基础数据获取
export function homePageInfo() {
    return request.get<BaseResponse>({
        url: `promoter/home/getBasicData`
    })
}
// 首页统计数据获取
export function homeStatData() {
    return request.get<BaseResponse>({
        url: `promoter/home/getStatData`
    })
}
// 分页获取推广订单
export function getPromoterOrder(data: object) {
    return request.post<BaseResponse>({
        url: `promoter/order/getOrderPage`,
        data
    })
}
// 邀请人列表Withdrawal method
export function getInviterList(data: object) {
    return request.post<BaseResponse>({
        url: `promoter/order/getBrokeragePage`,
        data
    })
}
// 提现记录
export function getWithdrawalRecord(data: object) {
    return request.post<BaseResponse>({
        url: `promoter/finance/withdrawalRecord`,
        data
    })
}
// 账单流水
export function transactionHistory(data: object) {
    return request.post<BaseResponse>({
        url: `promoter/finance/getBillPage`,
        data
    })
}
// 增加/修改提现方式
export function updateWithdrawalMethod(data: object) {
    return request.post<BaseResponse>({
        url: `promoter/finance/putBank`,
        data
    })
}
// 提现方式
export function getWithdrawalMethod() {
    return request.get<BaseResponse>({
        url: `promoter/finance/getBank`
    })
}

// 提现发送验证码
export function sendCode(data: object) {
    return request.get<BaseResponse>({
        url: `promoter/finance/getVerifyCode`,
        params: data
    })
}
// 提现
export function withdrawOperation(data: object) {
    return request.post<BaseResponse>({
        url: `promoter/finance/withdraw`,
        data
    })
}
// 分销推广-默认基础配置查询
export function basicConfiguration() {
    return request.get<BaseResponse>({
        url: `promoter/home/getDefault`
    })
}